package com.home.jinlanhua.controller;

import com.home.jinlanhua.entity.User;
import com.home.jinlanhua.exception.CustomerException;
import com.home.jinlanhua.result.Result;
import com.home.jinlanhua.service.impl.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * @program: jinlanhua
 * @description:
 * @author: Mr.Wang
 * @create: 2020-07-06 14:10
 **/
@Controller
@RequestMapping("/admin")
public class AdminController extends BaseController{
    @Autowired
    UserService userService;

    /**
     * 用户登录接口
     * @return
     */
    @RequestMapping(value = "login", method = RequestMethod.POST)
    @ResponseBody
    public Result<HashMap<String, String>> login(@RequestBody User user) throws CustomerException {
        return Result.success("成功",userService.login(user));
    }

}
